package lab02.Text06;

public class Triangle {
    //属性：三条边、面积、周长、boolean
    double a;
    double b;
    double c;
    double s=(a+b+c)/2;
    double perimeter;
    double area;
    boolean Triangle;
    //行为：周长、面积、修改三边
    double getPerimeter(){
        double perimeter=a+b+c;
        System.out.println("三角形的周长："+perimeter);
        return  0;
    }

    double getArea () {
        double  area=Math.sqrt(s*(s-a)*(s-b)*(s-c));
        System.out.println("三角形的面积：" +area);
        return 0;
    }
    boolean isTriangle(){
        if(a+b>c&&a+c>b&&b+c>a){
            Triangle=true;
            System.out.println("这是个三角形");
        }else
            System.out.println("这不是三角形！");
        return Triangle;
    }
    //构造函数
    //main函数
    public static void main(String[] args) {
        Scanner i=new Scanner(System.in);
        double a=i.nextDouble();
        double b=i.nextDouble();
        double c=i.nextDouble();
        double s=(a+b+c)/2;
        Triangle n=null;
        n=new Triangle();
        n.a=a;
        n.b=b;
        n.c=c;
        n.s=s;
        n.getPerimeter();
        n.getArea();
        n.isTriangle();

    }
}
